package com.example.demo2.d3;

/**
 * @author renyitong
 * @version 1.0.0
 * @createTime 2025年11月19日
 * @Description
 */
public class FlexibleInterfaceImpl implements MyInterface{

    private final Runnable runnable;

    public FlexibleInterfaceImpl(Runnable runnable) {
        this.runnable = runnable;
    }

    @Override
    public void a() {
        System.out.println("共同的a方法逻辑");
    }

    @Override
    public void b() {
        runnable.run();
    }

}
